package com.sugar.interceptor;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

/**
 * 自定义系统默认拦截器
 * @author Administrator
 *
 */
public class SystemInterceptor extends AbstractInterceptor {

	private static final long serialVersionUID = 1L;
	
	private Log log = LogFactory.getLog(getClass()) ;

	@Override
	public String intercept(ActionInvocation invocation) throws Exception {
		
		String nameSpace = invocation.getProxy().getNamespace() ;
		String actionName = invocation.getProxy().getActionName() ;
		String actionMethod = invocation.getProxy().getMethod() ;
		
		//继续往下执行
		invocation.invoke() ;
		
		log.info("执行：" + nameSpace + actionName + "!" + actionMethod + ".action" + "  [拦截器：" + this.getClass().getName() + "]") ;
		
		return null;
	}

}
